package com.wkq.dao;

import com.wkq.domain.Product;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface IProductDao {

//    查询全部数据
    @Select(" select id, productNum, productName, cityName, DepartureTime, productPrice, productDesc, productStatus from product ")
    public List<Product> findAll ();

//    添加单个产品数据
    @Insert(" insert into product(productNum, productName, cityName, departureTime, productPrice, productDesc, productStatus) " +
            "values(#{productNum},#{productName},#{cityName},#{departureTime},#{productPrice},#{productDesc},#{productStatus}) ")
    public void insertSingleData (Product product);

    @Select(" select id, productNum, productName, cityName, DepartureTime, productPrice, productDesc, productStatus from product where id = #{id} ")
    public Product findById (int id);
}
